home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Serial.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Universal Interfaces 2.0a1. ETO #15, MPW prerelease. Sunday, July 17, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __SERIAL__
- #define __SERIAL__
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- /* #include <ConditionalMacros.h> */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- #ifdef __CFM68K__
- #pragma lib_export on
- #endif
-
-
- enum {
- baud300 = 380,
- baud600 = 189,
- baud1200 = 94,
- baud1800 = 62,
- baud2400 = 46,
- baud3600 = 30,
- baud4800 = 22,
- baud7200 = 14,
- baud9600 = 10,
- baud19200 = 4,
- baud57600 = 0,
- stop10 = 16384,
- stop15 = -32768,
- stop20 = -16384,
- noParity = 0,
- oddParity = 4096,
- evenParity = 12288,
- data5 = 0,
- data6 = 2048,
- data7 = 1024,
- data8 = 3072
- };
-
- enum {
- ctsEvent = 32,
- breakEvent = 128,
- xOffWasSent = 128,
- dtrNegated = 64,
- ainRefNum = -6, /*serial port A input*/
- aoutRefNum = -7, /*serial port A output*/
- binRefNum = -8, /*serial port B input*/
- boutRefNum = -9 /*serial port B output*/
- };
-
- enum {
- sPortA,
- sPortB
- };
-
- typedef SInt8 SPortSel;
-
- struct SerShk {
- Byte fXOn; /*XOn flow control enabled flag*/
- Byte fCTS; /*CTS flow control enabled flag*/
- unsigned char xOn; /*XOn character*/
- unsigned char xOff; /*XOff character*/
- Byte errs; /*errors mask bits*/
- Byte evts; /*event enable mask bits*/
- Byte fInX; /*Input flow control enabled flag*/
- Byte fDTR; /*DTR input flow control flag*/
- };
- typedef struct SerShk SerShk;
-
- struct SerStaRec {
- Byte cumErrs;
- Byte xOffSent;
- Byte rdPend;
- Byte wrPend;
- Byte ctsHold;
- Byte xOffHold;
- };
- typedef struct SerStaRec SerStaRec;
-
- extern pascal OSErr SerReset(short refNum, short serConfig);
- extern pascal OSErr SerSetBuf(short refNum, Ptr serBPtr, short serBLen);
- extern pascal OSErr SerHShake(short refNum, const SerShk *flags);
- extern pascal OSErr SerSetBrk(short refNum);
- extern pascal OSErr SerClrBrk(short refNum);
- extern pascal OSErr SerGetBuf(short refNum, long *count);
- extern pascal OSErr SerStatus(short refNum, SerStaRec *serSta);
-
- #ifdef __CFM68K__
- #pragma lib_export off
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SERIAL__ */
-